package org.groupg.practice.guava;

import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import com.google.common.util.concurrent.ThreadFactoryBuilder;

public class ThreadFactoryExample {
    public static void main(String[] args) {
        ThreadFactory threadFactory = new ThreadFactoryBuilder()
            .setNameFormat("thread-%d")
            .setPriority(Thread.MAX_PRIORITY)
            .build();

        Executors.newSingleThreadExecutor(threadFactory).submit(() -> {
            System.out.println("自定义线程名称和优先级");
        });
    }
}